[postgresql] Меняем owner’a для всех таблиц в базе

Собственно сам скрипт. В нём так же есть проверка на запуск от нужного юзера. #!/bin/sh DB_NAME=$1 PSQL=/usr/bin/psql EGREP=/usr/bin/egrep if [ $# = 1 ] then if [ `id -nu` = ‘postgres’ ] then for S in `$PSQL -qAt -c “SELECT schema_name FROM information_schema.schemata;” $DB_NAME | $EGREP -v ‘pg_|information_schema’` do for tbl in `$PSQL -qAt -c … Читати далі [postgresql] Меняем owner’a для всех таблиц в базе